<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>录入信息</title>

<!-- css 样式 start-->
<link rel="stylesheet" href=".../../themes/skyblue/skyblueMain.css" type="text/css" title="styles1" />
<!-- css 样式  end-->
<!-- common javascript start-->
<script language="javascript" src=".../../themes/js/common.js"></script>
<script language="javascript" src=".../../themes/js/Validate.js"></script>
<script language="javascript" src=".../../themes/My97DatePicker/WdatePicker.js"></script>
<!-- common javascript end-->

</head>

<body>
<div id="main">
  	<div id="tab-top">
  		<div id="ptk1">
	  		<div id="lift"></div>
	  		<div id="pt">【用户管理】信息录入</div>
	  		<div id="right"></div>
  		</div>
 	</div>
<form action="action.com.auth.user.TAuthUserInsert.do" method="post" onsubmit="return checkForm();">
	<div id="table">
   		<div id="ptk">
   			<div id="tabtop-l"></div>
    		<div id="tabtop-z">信息录入</div>
    		<div id="tabtop-r1"></div>
    	</div>
  	</div>  	
  	<div id="main-tab">
	    <div id="info">    	
			<table width="95%" border="0" align="center" cellpadding="5" cellspacing="1">
			  <tr>
				<td width="16%" class="label">用户ID：</td>
				<td width="84%">
				<input type="text" size="20" name="tAuthUser_id" 
					size="20"/>
				</td>
			  </tr>
			  <tr>
				<td width="16%" class="label">密码：</td>
				<td width="84%">
				<input type="text" size="20" name="tAuthUser_password" 
					size="20"/>
				</td>
			  </tr>
			  <tr>
				<td width="16%" class="label">姓名：</td>
				<td width="84%">
				<input type="text" size="20" name="tAuthUser_name" 
					size="20"/>
				</td>
			  </tr>
			  <tr>
				<td width="16%" class="label">性别：</td>
				<td width="84%">
					<select name="tAuthUser_sex">
						<option value="1">男</option>
						<option value="2">女</option>
				</select>
				</td>
			  </tr>
			  <tr>
				<td width="16%" class="label">职务：</td>
				<td width="84%">
					<select name="tAuthUser_position">
						<option value="3">经理</option>
						<option value="2">主管</option>
						<option value="1">一般员工</option>
				</select>
				</td>
			  </tr>
			  <tr>
				<td width="16%" class="label">电子邮件：</td>
				<td width="84%">
				<input type="text" size="20" name="tAuthUser_email" 
					size="20"/>
				</td>
			  </tr>
			  <tr>
				<td width="16%" class="label">手机号码：</td>
				<td width="84%">
				<input type="text" size="0" name="tAuthUser_phone" 
					size="20"/>
				</td>
			  </tr>
			  <tr>
				<td width="16%" class="label">座机号码：</td>
				<td width="84%">
				<input type="text" size="0" name="tAuthUser_tel" 
					size="20"/>
				</td>
			  </tr>
			  <tr>
				<td width="16%" class="label">状态：</td>
				<td width="84%">
					<select name="tAuthUser_status">
						<option value="1">不可用</option>
						<option value="2">可用</option>
				</select>
				</td>
			  </tr>
			  <tr>
				<td width="16%" class="label">角色：</td>
				<td width="84%">
					<select name="tAuthUser_roleId">
						<logic:present name="tAuthRoleList" scope="request">
						<logic:iterate id="tAuthRole" name="tAuthRoleList" scope="request">
						<option value="${tAuthRole.id}">${tAuthRole.name}</option>
						</logic:iterate>
						</logic:present>
				</select>
				</td>
			  </tr>
			  <tr>
				<td width="16%" class="label">部门：</td>
				<td width="84%">
					<select name="tAuthUser_departmentId">
						<logic:present name="tAuthDepartmentList" scope="request">
						<logic:iterate id="tAuthDepartment" name="tAuthDepartmentList" scope="request">
						<option value="${tAuthDepartment.id}">${tAuthDepartment.name}</option>
						</logic:iterate>
						</logic:present>
				</select>
				</td>
			  </tr>
			  <tr>
				<td width="16%" class="label">联系地址：</td>
				<td width="84%">
				<input type="text" size="50" name="tAuthUser_address" 
					size="20"/>
				</td>
			  </tr>
			  <tr>
				<td width="16%" class="label">说明：</td>
				<td width="84%">
				<input type="text" size="50" name="tAuthUser_userDescribe" 
					size="20"/>
				</td>
			  </tr>
			</table>

			<div id="fh-flie-2"></div>
			<div id="main-tabk2">
				<ul>
						<li><input type="submit" value="提交" /></li>
			        	<li><input type="button" value="取消" onclick="javascript:history.back();" />
					</li>
				</ul>
			</div>
			
		</div>
	</div>
</form>
</div>
</body>
</html>

<script type="text/javascript">
function checkForm(){
	var idValue = document.getElementsByName("tAuthUser_id").item(0).value;
	
	if(idValue == ""){
		alert("请输入相关信息");
		document.getElementsByName("tAuthUser_id").item(0).focus();
		return false;
	}
	var passwordValue = document.getElementsByName("tAuthUser_password").item(0).value;
	
	if(passwordValue == ""){
		alert("请输入相关信息");
		document.getElementsByName("tAuthUser_password").item(0).focus();
		return false;
	}
	var nameValue = document.getElementsByName("tAuthUser_name").item(0).value;
	
	if(nameValue == ""){
		alert("请输入相关信息");
		document.getElementsByName("tAuthUser_name").item(0).focus();
		return false;
	}
	var emailValue = document.getElementsByName("tAuthUser_email").item(0).value;
	
	if(emailValue == ""){
		alert("请输入相关信息");
		document.getElementsByName("tAuthUser_email").item(0).focus();
		return false;
	}
	if( check_EMAIL(emailValue) == false){
		document.getElementsByName("tAuthUser_email").item(0).focus();
		return false;
	}
	var phoneValue = document.getElementsByName("tAuthUser_phone").item(0).value;
	
	var telValue = document.getElementsByName("tAuthUser_tel").item(0).value;
	
	var addressValue = document.getElementsByName("tAuthUser_address").item(0).value;
	
	var userDescribeValue = document.getElementsByName("tAuthUser_userDescribe").item(0).value;
	
	return true;
}
</script>